<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt"%>
<c:set var="htmlTitle" value="智慧停车"/>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
  	<!-- START SCRIPTS -->
        <!-- START PLUGINS -->
        <script type="text/javascript" src="${ctx}/static/js/plugins/jquery/jquery.min.js"></script>
        <script type="text/javascript" src="${ctx}/static/js/plugins/jquery/jquery-ui.min.js"></script>
        <script type="text/javascript" src="${ctx}/static/js/plugins/bootstrap/bootstrap.min.js"></script>        
        <!-- END PLUGINS -->

        <!-- START THIS PAGE PLUGINS-->        
        <script type='text/javascript' src='${ctx}/static/js/plugins/icheck/icheck.min.js'></script>        
        <script type="text/javascript" src="${ctx}/static/js/plugins/mcustomscrollbar/jquery.mCustomScrollbar.min.js"></script>
        <script type="text/javascript" src="${ctx}/static/js/plugins/scrolltotop/scrolltopcontrol.js"></script>
        
        <script type="text/javascript" src="${ctx}/static/js/plugins/morris/raphael-min.js"></script>
        <script type="text/javascript" src="${ctx}/static/js/plugins/morris/morris.min.js"></script>       
        <script type="text/javascript" src="${ctx}/static/js/plugins/rickshaw/d3.v3.js"></script>
        <script type="text/javascript" src="${ctx}/static/js/plugins/rickshaw/rickshaw.min.js"></script>
        <script type='text/javascript' src='${ctx}/static/js/plugins/jvectormap/jquery-jvectormap-1.2.2.min.js'></script>
        <script type='text/javascript' src='${ctx}/static/js/plugins/jvectormap/jquery-jvectormap-world-mill-en.js'></script>                
        <script type='text/javascript' src='${ctx}/static/js/plugins/bootstrap/bootstrap-datepicker.js'></script>                
        <script type="text/javascript" src="${ctx}/static/js/plugins/owl/owl.carousel.min.js"></script>                 
        
        <script type="text/javascript" src="${ctx}/static/js/plugins/daterangepicker/daterangepicker.js"></script>
        
        <script type='text/javascript' src='${ctx}/static/js/plugins/bootstrap/bootstrap-clockpicker.min.js'></script> 
        <script type="text/javascript" src="${ctx}/static/js/plugins/jquery/jquery-clockpicker.min.js"></script>
        
        <!-- END THIS PAGE PLUGINS-->        

        <!-- START TEMPLATE -->
        
        <script type="text/javascript" src="${ctx}/static/js/plugins.js"></script>        
        <script type="text/javascript" src="${ctx}/static/js/actions.js"></script>
        
        <!-- END TEMPLATE -->
        
        <script type="text/javascript" src="${ctx}/static/js/plugins/datatables/jquery.dataTables.js"></script>
        <script type='text/javascript' src='${ctx}/static/js/plugins/validationengine/languages/jquery.validationEngine-zh_CN.js'></script>
		<script type='text/javascript' src='${ctx}/static/js/plugins/validationengine/jquery.validationEngine.js'></script>
		<script type='text/javascript' src='${ctx}/static/js/plugins/jquery-validation/jquery.validate.js'></script>
		<script type="text/javascript" src="${ctx}/static/js/plugins/bootstrap/bootstrap-select.js"></script>
		<script type='text/javascript' src='${ctx}/static/js/plugins/jquery/jquery.form.js'></script>
        
        <script src="${ctx}/static/js/jquery/mosaic.1.0.1.js"></script>
		<script src="${ctx}/static/js/jquery/lrtk.js"></script> 
		<script src="${ctx}/static/js/echarts.min.js"></script> 
    <!-- END SCRIPTS -->
    
    
    <!-- CSS INCLUDE -->        
        <link rel="stylesheet" href="${ctx}/static/css/theme-default.css" type="text/css" id="theme" />
        <link rel="stylesheet" href="${ctx}/static/css/style.css" type="text/css" media="all" />
		<link rel="stylesheet" href="${ctx}/static/css/jquery/lrtk.css" type="text/css" media="" />
    <!-- EOF CSS INCLUDE -->      
        
    	<script type="text/javascript">
    	var ctx = '${ctx}';
    	
    	function closeWin() {
			$("#errText").html("");
			$("#message-box-sound").removeClass("open");
		}
    	
    	function clearPwd() {
			$("#pwd1").val("");
			$("#pwd2").val("");
		}
		
    	function updatePwd() {
    		clearPwd();
  			$("#updatePwdModalLabel").html("修改密码");
	 		$("#updatePwdModal").modal("show");
    	}
    	
    	function updatePassword() {
	    	var pwd1 = $("#pwd1").val();
	    	var pwd2 = $("#pwd2").val();
	    	var url = ctx + "/user/updatePassword";
	    	$.post(
	    	 	url,
	    	 	{ 
	    	 		"pwd1":pwd1,
	    	 		"pwd2":pwd2
	    	 	},
	    	 	function(result){
	    	 		var rtn = JSON.parse(result);
	            	if(rtn.code == 1)
	            	{
	                	$("#updatePwdModal").modal("hide");
	                	$("#info").html(rtn.text);
	 			   		$("#infoModal").modal("show");
	            	} else {
	            		$("#message-box-sound").addClass("open");
						$("#errText").html(rtn.text);
	            	}
	    	 	}
	    	 );
    	}
    	
    	</script>
    
    	<!-- START PRELOADS -->
<!--         <audio id="audio-alert" src="audio/alert.mp3" preload="auto"></audio> -->
<!--         <audio id="audio-fail" src="audio/fail.mp3" preload="auto"></audio> -->
        <!-- END PRELOADS --> 
    
    	<!-- MESSAGE BOX-->
        <div class="message-box animated fadeIn" data-sound="alert" id="mb-signout">
            <div class="mb-container">
                <div class="mb-middle">
                    <div class="mb-title"><span class="fa fa-sign-out"></span> Log <strong>Out</strong> ?</div>
                    <div class="mb-content">
                        <p>Are you sure you want to log out?</p>                    
                        <p>Press No if youwant to continue work. Press Yes to logout current user.</p>
                    </div>
                    <div class="mb-footer">
                        <div class="pull-right">
                            <a href="${ctx}/signout" class="btn btn-success btn-lg">Yes</a>
                            <button class="btn btn-default btn-lg mb-control-close">No</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- END MESSAGE BOX-->

        <!-- default with sound -->
		<div class="message-box animated fadeIn" id="message-box-sound">
			<div class="mb-container">
				<div class="mb-middle">
					<div class="mb-title">
						<span class="fa fa-globe"></span>Warning
					</div>
					<div class="mb-content">
						<p id="errText"></p>
					</div>
					<div class="mb-footer">
						<button onclick="closeWin()"
							class="btn btn-info btn-lg pull-right mb-control-close">
							Close
						</button>
					</div>
				</div>
			</div>
		</div>
		<!-- end default with sound -->
		
		<!-- info modal -->
		<div class="modal fade" id="infoModal" tabindex="-1" role="dialog" aria-labelledby="infoModalLabel" aria-hidden="true">
		    <div class="modal-dialog">
		        <div class="modal-content">
		            <div class="modal-header">
		                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
		                        aria-hidden="true">&times;</span></button>
		                <h4 class="modal-title" id="infoModalLabel">提示信息</h4>
		            </div>
		            <div id="info" class="modal-body">
		            	
		            </div>
		            <div class="modal-footer">
		                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
		            </div>
		        </div>
		    </div>
		</div>
		<!-- 信息删除确认 -->  
		<div class="modal fade" id="deleteModal">  
		  <div class="modal-dialog">  
		    <div class="modal-content message_align">  
		      <div class="modal-header">  
		        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>  
		        <h4 class="modal-title">提示信息</h4>  
		      </div>  
		      <div class="modal-body">  
		        <p>您确认要删除吗？</p>  
		      </div>  
		      <div class="modal-footer">  
		         <input id="deleteId" type="hidden">
		         <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>  
		         <a  onclick="delSubmit()" class="btn btn-success" data-dismiss="modal">确定</a>  
		      </div>  
		    </div><!-- /.modal-content -->  
		  </div><!-- /.modal-dialog -->  
		</div><!-- /.modal -->  


		<div class="modal fade" id="updatePwdModal" tabindex="-1" role="dialog" aria-labelledby="updatePwdModalLabel" aria-hidden="true">
		    <div class="modal-dialog">
		        <div class="modal-content">
		            <div class="modal-header">
		                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
		                        aria-hidden="true">&times;</span></button>
		                <h4 class="modal-title" id="updatePwdModalLabel">修改密码</h4>
		            </div>
		            <div class="modal-body">
	               		<form id="jvalidate2" class="form-horizontal" role="form">                                    
                              <div class="form-group">
                                  <label class="col-md-2 control-label">新密码</label>
                                  <div class="col-md-10">
                                      <input id="pwd1" name="pwd1" type="text" class="form-control" placeholder="请输入新密码"/>
                                  </div>
                              </div>
                              <div class="form-group">
                                  <label class="col-md-2 control-label">确认密码</label>
                                  <div class="col-md-10">
                                      <input id="pwd2" name="pwd2" type="text" class="form-control" placeholder="请再次输入密码"/>
                                  </div>
                              </div>
                        </form>
		            </div>
		            <div class="modal-footer">
		                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
		                <button type="button" class="btn btn-primary" id="save" onclick="updatePassword()">保存</button>
		            </div>
		        </div>
		    </div>
		</div>